package collection;

import java.lang.annotation.Annotation;

/**
 * Created by butterfly on 2018/6/5.
 */
public class R {
    int count;

    public R(int count) {
        this.count = count;
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof R){
            R r = (R) o;
            if (r.count == this.count){
                return true;
            }
        }
        return false;
    }


    @Override
    public int hashCode() {
        return this.count;
    }

    @Override
    public String toString() {
        return "R{" +
                "count=" + count +
                '}';
    }

    public static void main(String[] args) {
        try {
            Annotation[] annotations = new ListDemo().getClass().getMethod("test").getAnnotations();
            for (Annotation annotation : annotations) {
                System.out.println(annotation.getClass());
            }
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }
    }
}
